﻿using DataAccess.Domain;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccess.EntityHelper
{
    public class DataContext : DbContext
    {
        private const string connectionString = "Data Source=.;Initial Catalog=FashionShop;Integrated Security=True";
        public DataContext()
            : base("FashionShopConnectionString")
        {
            Database.SetInitializer<DataContext>(new DropCreateDatabaseAlways<DataContext>());
            this.Database.Connection.ConnectionString = connectionString;
        }
        
        public DbSet<Account> Accounts { get; set; }
        public DbSet<Business> Businesses { get; set; }
        public DbSet<Category> Categories { get; set; }
        public DbSet<Comment> Comments { get; set; }
        public DbSet<Customer> Customers { get; set; }
        public DbSet<Order> Orders { get; set; }
        public DbSet<OrderDetail> OrderDetails { get; set; }
        public DbSet<Product> Products { get; set; }
        public DbSet<Role> Roles { get; set; }

    }
}
